package chenji.dailykit.ItemEditor.operationnode;

import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

import chenji.dailykit.ItemEditor.ItemEditor;

/**
 * @author ChenJi Copyright (c) 2016 ChenJi. All rights reserved.
 */
public abstract class OperationNode {

	private ItemStack item;
	private int nowpage;
	private int maxpage;
	private boolean showpageitem;
	private ItemEditor e;
	private Player p;

	public OperationNode(ItemStack i, ItemEditor e, Player p) {

		this.p = p;
		this.showpageitem = false;
		this.item = i;
		this.e = e;
	}

	public OperationNode(ItemStack i, ItemEditor e, Player p, boolean chengePage, int MaxPage) {
		this.p = p;
		this.showpageitem = chengePage;
		this.item = i;
		this.e = e;
		this.maxpage = MaxPage;
	}

	public Player getPlayer() {
		return this.p;
	}

	public OperationNode(ItemStack i, int maxpage) {
		this.item = i;
		this.maxpage = maxpage;
		this.showpageitem = true;
	}

	public final int getNowPage() {
		return this.nowpage;
	}

	public final ItemEditor getItemEditor() {
		return this.e;
	}

	public final int getyMaxPage() {
		return this.maxpage;
	}

	public final boolean getShowPageItem() {
		return this.showpageitem;
	}

	public final ItemStack getItem() {
		return this.item;
	}

	public abstract void setInventory(final Inventory inv);

	public abstract void Click(final int slot);

	public abstract void upPage();

	protected final void chengePage(final int nowPage) {
		this.nowpage = nowPage;
	}

	public abstract void downPage();

	public abstract boolean setChat(final String m);

	public final void setNowPage(final int i) {
		this.nowpage = i;
	}

}
